// pages/index/null/index.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
		imgurl: app.urlimg,
		goods_list:[],
  },

  /**
   * 生命周期函数--监听页面加载
   */
	onLoad: function (options) {
		var that = this;
		wx.request({
      url: app.url + 'api_team/get_favoriteV1',
			data: {
			},
			header: {
				'content-type': 'application/json',
				'token': wx.getStorageSync('token_key')
			},
			success: function (res) {
				that.setData({
          goods_list: res.data.result.likegoods,
				})
			}
		})

	},
	// 猜你喜欢板块被点击
	like_click: function (e) {
		var that = this;
		console.log("猜你喜欢板块被点击，跳转到id对应的商品详情");
    console.log(e);
		wx.redirectTo({
			url: '/pages/index/detail/index?id=' + e.currentTarget.dataset.goods_id,
		})
	},
	//点击返回首页
	home_click:function(){
		wx.reLaunch({
			url: '/pages/index/index',
		})
	},

})